<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

//@Override
class MY_Controller extends CI_Controller {
    public function __construct() {
        parent::__construct();
        
        //$this->load->database();
        
        $user_name = $this->session->userdata('login');
        $logged_in = $this->session->userdata('logged_in');
        if ($user_name != NULL && $logged_in == TRUE){
            //redirect('');
            //putenv ("NLS_LANG=AMERICAN_AMERICA.AL32UTF8");
        }else{
            $refer = uri_string() == ""?"":"?refer=".urlencode(filter_input(INPUT_SERVER, 'REQUEST_URI'));
            redirect('user/auth'.$refer); // the user is not logged in, redirect them!
        }
        
    }
    
}
